"use strict";
function findObjById(obj, id) {
    const temp = obj.find(item => item.id == id);
    //返回的对象，电话号码需要处理
    const regexp = /(\d{3})\d{4}(\d{4})/;
    temp === null || temp === void 0 ? void 0 : temp.phone.replace(regexp, "$1****$2");
    return temp;
}
let array = [
    { id: 1, name: "xiaowang", phone: "13790089763" },
    { id: 2, name: "xiaofei", phone: "13567890872" }
];
findObjById(array, 1);
